Integrand size = 19, antiderivative size = 66 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {\text {arctanh}(\cos (c+d x))}{a d}+\frac {b \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{a \sqrt {a^2+b^2} d} \]
[Out]
Time = 0.17 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3599, 3189, 3855, 3153, 212} \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {b \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{a d \sqrt {a^2+b^2}}-\frac {\text {arctanh}(\cos (c+d x))}{a d} \]
[In]
[Out]
Rule 212
Rule 3153
Rule 3189
Rule 3599
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \int \frac {\cot (c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx \\ & = \int \left (\frac {\csc (c+d x)}{a}-\frac {b}{a (a \cos (c+d x)+b \sin (c+d x))}\right ) \, dx \\ & = \frac {\int \csc (c+d x) \, dx}{a}-\frac {b \int \frac {1}{a \cos (c+d x)+b \sin (c+d x)} \, dx}{a} \\ & = -\frac {\text {arctanh}(\cos (c+d x))}{a d}+\frac {b \text {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,b \cos (c+d x)-a \sin (c+d x)\right )}{a d} \\ & = -\frac {\text {arctanh}(\cos (c+d x))}{a d}+\frac {b \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{a \sqrt {a^2+b^2} d} \\ \end{align*}
Time = 0.35 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.14 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {-\frac {2 b \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}}-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{a d} \]
[In]
[Out]
Time = 0.75 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.95
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {2 b \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{a \sqrt {a^{2}+b^{2}}}}{d}\) | \(63\) |
default | \(\frac {\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {2 b \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{a \sqrt {a^{2}+b^{2}}}}{d}\) | \(63\) |
risch | \(-\frac {i b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i b +a}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, d a}+\frac {i b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i b +a}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, d a}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a d}\) | \(150\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 183 vs. \(2 (62) = 124\).
Time = 0.31 (sec) , antiderivative size = 183, normalized size of antiderivative = 2.77 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\sqrt {a^{2} + b^{2}} b \log \left (\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - {\left (a^{2} + b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a^{2} + b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{3} + a b^{2}\right )} d} \]
[In]
[Out]
\[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\int \frac {\csc {\left (c + d x \right )}}{a + b \tan {\left (c + d x \right )}}\, dx \]
[In]
[Out]
none
Time = 0.52 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.62 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {b \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}} a} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a}}{d} \]
[In]
[Out]
none
Time = 0.43 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.42 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {b \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} a} + \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a}}{d} \]
[In]
[Out]
Time = 4.91 (sec) , antiderivative size = 174, normalized size of antiderivative = 2.64 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{a\,d}-\frac {2\,b\,\mathrm {atanh}\left (\frac {\sqrt {a^2+b^2}\,\left (1{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+2{}\mathrm {i}\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b+4{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2\right )}{b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,4{}\mathrm {i}+a\,b^2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}+a^2\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,3{}\mathrm {i}+a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2+b^2\right )\,1{}\mathrm {i}}\right )}{a\,d\,\sqrt {a^2+b^2}} \]
[In]
[Out]